//1. 引入redux, 
//2. createStore( reducer )
import { applyMiddleware, combineReducers, createStore, compose } from 'redux'
import TabbarReducer from './reducers/TabbarReducer'
import reduxThunk from 'redux-thunk'
import reduxPromise from 'redux-promise'
import LineLossTempReducer from './reducers/LineLossTempReducer'
import LineLossFillReducer from './reducers/LineLossFillReducer'
import IndexReducer from './reducers/IndexReducer'
//  合并reducer
const reducer = combineReducers({
  LineLossFillReducer,
  TabbarReducer,
  LineLossTempReducer,
  IndexReducer
})

const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose

const Store = createStore(reducer, composeEnhancers(applyMiddleware(reduxThunk, reduxPromise)))


export default Store
